#!/bin/bash
# Author: yanjingtu <yanjingtu2008@yeah.net>
# Date: 2020/7/24
# Url: https://gitee.com/yanjingtu/centos-dockerfiles/tree/master/scripts/

#yum install -q -y maven \
#&& mkdir -p /usr/share/java/maven-3/conf \
#&& cp -f /settings.xml /usr/share/java/maven-3/conf/settings.xml \
#&& mkdir -p /usr/share/maven/conf \
#&& mv -f /settings.xml /usr/share/maven/conf/settings.xml \
#&& yum clean all

curl http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz | tar -C /opt -zx
mv -f /settings.xml /opt/apache-maven-3.6.3/conf/settings.xml

if [ -f /usr/bin/mvn ]; then
    if ! [ -x /usr/bin/mvn ]; then
        chmod +x /usr/bin/mvn
    fi
fi
